﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;//引入反射命名空间
using System.Configuration;//引入配置文件命名空间
using ICameraClassLibrary;//引用自定义的接口类库

namespace FactoryClassLibrary
{
    public class CameraFactory
    {
        //读取 APP.config 配置
        private static string dllPath = ConfigurationManager.AppSettings["动态链接库路径"];
        private static string className = ConfigurationManager.AppSettings["类名"];

        public static ICamera CreateInstance()
        {
            return Assembly.Load(dllPath).CreateInstance(className) as ICamera;
        }

    }
}
